Skip to main content

SetBackendServers

Description

call SetBackendServers to set back-end server weights.

Request Method

POST

Request Path

/apsara/route/Slb/SetBackendServers

Request Parameters Common Parameters

NameLocationTypeRequiredSample valueDescription
regionIdBODYstringYesNo sample value for this parameter.region id
LoadBalancerIdBODYstringYeslb-bp1qjwo61pqz3a****load balancing instance ID.
BackendServersBODYstringYes[{ "ServerId": "i-xxxxxxxxx", "Weight": "100", "Type": "ecs", "Port":"80","Description":"test-112" }]list of back-end servers to be added. Value: is a Json string, and its structure is a JsonList. In a request, the list supports up to 20 elements. ServerId:String type, required, instance ID of the backend server. Port:Integer type, required, port used by backend server, value range:1~65535. Weight:Integer type, required, weight of backend server, value range:0~100. Description :String type, optional, backend server description, length 1-80 characters, allow letters, numbers, dashes (-), forward slashes (/), half-width periods (.), and underscores (_). Chinese is supported. Type:String type, indicating the instance type of the backend server, value: ecs(default): ECS instance. eni: ENI instance. ServerIp: the instance IP of ECS or ENI. The example is as follows: example of mounting ECS:[{ "ServerId": "i-xxxxxxxxx", "Weight": "100", "Type": "ecs", "Port": "80", "Description": "test-112" }] mount ENI:[{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.**.**", "Port": "80", "Description": "test-112" }] mount ENI multi-IP:[{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.**.**", "Port": "80", "Description": "test-112" },{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "172.166.**.**", "Port": "80", "Description": "test-113" }] description must be a running backend server instance to join the load balancing instance, and a maximum of 20 backend servers can be added for each call. at the same time, only guaranteed-performance instances can add eni backend servers.
versionBODYstringNo2016-01-01version of api

Return data

NameTypeSample valueDescription
Typestringecsbackend server type, value: ecs(default):ECS instance. eni: ENI instance.
ServerIdstringeni-hg231****ECS instance ID.
Descriptionstringbackend serverbackend server description.
RequestIdstring365F4154-92F6-4AE4-92F8-7FF34B540710request ID.
BackendServerNo sample value for this parameter.No description for this parameter.
LoadBalancerIdstringlb-bp1qjwo61pqz3a****load balancing instance ID.
BackendServersarray of backendserverNo sample value for this parameter.backend server list.
Weightstring100the weight of the back-end server.

Example

Successful Response example

{
"Type":"ecs",
"ServerId":"eni-hg231****",
"Description":"backend server",
"RequestId":"365F4154-92F6-4AE4-92F8-7FF34B540710",
"BackendServer":"",
"LoadBalancerId":"lb-bp1qjwo61pqz3a****",
"BackendServers":"",
"Weight":"100"
}

Failed Response example

{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}

}